import Taro, { Component } from '@tarojs/taro'
import { View, Text } from '@tarojs/components'
import { AtButton,AtMessage } from 'taro-ui'
import './meassage.scss'

export default class Meassage extends Component {

    config = {
      navigationBarTitleText: '首页'
    } 
  
    constructor () {
      super(...arguments)
      this.state = {
      }
    }
    handleClick(value){
            Taro.atMessage({
                'message':'通知消息',
                'type':value
            })
    }
    render(){
        return(
            <View>
                <AtMessage />
                <AtButton onClick={this.handleClick.bind(this)}>
                普通消息
                </AtButton>
                <AtButton onClick={this.handleClick.bind(this, 'success')}>
                成功消息
                </AtButton>
                <AtButton onClick={this.handleClick.bind(this, 'error')}>
                错误消息
                </AtButton>
                <AtButton onClick={this.handleClick.bind(this, 'warning')}>
                警告消息
                </AtButton>
            </View>
        )
    }
}    